/* String Library Functions available: 
*  substring, stringLength, stringFind, stringReplace, 
*  stringToUpper, stringToLower, stringFindAll, splitString
*/

string a <- "String LibRaRy";
print("**String is:");
print(a);
print("**Length:");
print(stringLength(a));
print("**Substring from 0 to 5 is:");
print(substring(a,0,5));
print("**Capitalizing...");
print(stringToUpper(a));
print("**Lower Casing...");
print(stringToLower(a));
print("**Restoring string and finding string \"RaR\"");
print(stringFind(a,"RaR"));
print("**Replacing string \"RaR\" with \"rar\"");
a <- stringReplace("RaR","rar",a);
print(a);
print("**Searching for lower case r\'s");
integer[] arr <- stringFindAll(a,"r");
integer index <- 0;
integer value <- 0;
foreach (index value in arr) {
	print(value);
}
print("**Splitting string by space");
string[] arr1 <- splitString(" ",a);
index <- 0;
value <- 0;
foreach (index value in arr1) {
	print(value);
}
